package com.spring.cloud.alibabaconsumer.controller;

import com.spring.cloud.alibaba.commons.pojo.OrderInfo;
import com.spring.cloud.alibaba.commons.pojo.ResponseVo;
import com.spring.cloud.alibabaconsumer.service.OrderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/create")
    public ResponseVo createOrder(@RequestBody OrderInfo orderEntity, @RequestParam("flag") Integer flag) {

        return orderService.createOrder(orderEntity, flag);
    }
}
